

/**
 * 分页
 */
module.exports = class Page {
    constructor(params) {
        let { pageNo, pageSize, totalNumber, data } = params;
        this.pageNo = pageNo;
        this.pageSize = pageSize;
        this.totalNumber = totalNumber;
        this.setTotalPageSize();
        this.data = data;
    }
    setTotalPageSize() {
        this.totalPageSize = this.totalNumber / this.pageSize;
        if (this.totalNumber % this.pageSize !== 0) {
            this.totalPageSize = Math.ceil(this.totalNumber / this.pageSize);
        }
    }
};

